/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.srcptit.trainning.luyennv.btvn1;

import java.util.Scanner;

/**
 *
 * @author Nhim
 */
public class Bai11 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        boolean test[] = new boolean[n];
        float a[] = new float[n];
        for(int i = 0; i < n; i++){
            a[i] = input.nextFloat();
            test[i] = true;
        }
        for(int i = 0; i < n; i++){
            if(test[i] == false) continue;
            else{
                int dem = 0;
                for(int j = i; j < n; j++){
                    if(a[j] == a[i]){
                        dem++;
                        test[j] = false;
                    }
                }
                System.out.println(a[i]+" "+dem);
            }
        }
    }
}
